/**
 * Copyright ©2016-2020 tianyu education Corporation, All Rights Reserved
 * http://www.whty.com.cn/
 */
package profile.hujia.profile.elasticsearch.study.config;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.text.SimpleDateFormat;

/**
 * class info
 *
 * @author hujia
 * @date 2019-08-15 14:50
 */
@Configuration
public class JacksonConfig {
    @Bean
    public ObjectMapper jackson() {
        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.setSerializationInclusion(JsonInclude.Include.ALWAYS);
//        objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
        //objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-ddTHH:mm:ss"));
        return objectMapper;
    }

}
